package com.nbsaas.boot.data.rest.convert;

import com.nbsaas.boot.data.data.entity.QueryMacro;
import com.nbsaas.boot.data.api.domain.response.QueryMacroResponse;

import com.nbsaas.boot.utils.BeanDataUtils;
import com.nbsaas.boot.rest.api.Converter;
import java.util.HashMap;
import java.util.Map;
/**
* -实体对象转化成响应对象
*/

public class QueryMacroResponseConvert  implements Converter<QueryMacroResponse,QueryMacro> {

    @Override
    public QueryMacroResponse convert(QueryMacro source) {
        QueryMacroResponse  result = new  QueryMacroResponse();
        BeanDataUtils.copyProperties(source, result);
                    if(source.getMacroType()!=null){
                    Map<Integer,String> MacroTypeMap=new HashMap<>();
                        MacroTypeMap.put(1,"公共宏");
                    String label=  MacroTypeMap.get(source.getMacroType());
                    result.setMacroTypeName(label);
                    }
                    result.setMacroType(source.getMacroType());
        return result;
    }

}

